package api

import (
	"github.com/gin-gonic/gin"
	"video-comments/api/handler"
)

func LoadRouter(r *gin.Engine) {
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.RegisterUser)
			user.POST("login", handler.LoginUser)
			user.POST("Delete", handler.DeleteUser)
		}

		comment := api.Group("/comment")
		{
			comment.POST("add", handler.AddComment)
			comment.GET("list", handler.ListComment)
			comment.GET("showByLikeNum", handler.ShowByLikeNumComment)
			comment.POST("delete", handler.DeleteComment)
			comment.GET("showByAuth", handler.ShowByAuthComment)
		}

		reply := api.Group("/reply")
		{
			reply.POST("add", handler.AddReply)
			reply.POST("delete", handler.DeleteReply)
			reply.GET("showByAuth", handler.ShowByAuthReply)
		}
	}
}
